package com.diankangwo.sys.service;

import com.diankangwo.common.utils.R;
import com.diankangwo.sys.entity.SysUserTokenEntity;

/** 管理系统用户Token
 * Created by wuye on 2017/9/5.
 */
public interface SysUserTokenService {

    SysUserTokenEntity queryByUserId(Long userId);

    SysUserTokenEntity queryByToken(String token);

    void save(SysUserTokenEntity token);

    void update(SysUserTokenEntity token);

    /**
     * 生成token
     * @param userId  用户ID
     */
    R createToken(long userId);

    /**
     * 退出，修改token值
     * @param userId  用户ID
     */
    void logout(long userId);
}
